//
//  MinePersonalHeadCell.m
//  PaiLeXiongProject
//
//  Created by 小獾科技 on 2017/9/8.
//  Copyright © 2017年 小獾科技. All rights reserved.
//

#import "MinePersonalHeadCell.h"

@interface MinePersonalHeadCell ()
@end

@implementation MinePersonalHeadCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        _leftImg = [UIImageView new];
        _leftImg.image = IMAGE(@"");
        [self addSubview:_leftImg];
        [_leftImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.mas_centerY);
            make.left.equalTo(self).offset(10);
            make.width.equalTo(@22);
            make.height.equalTo(@22);
        }];
        
        UILabel *label = [UILabel new];
        label.text = @"头像";
        label.textColor = ColorFrom16(0x333333);
        label.font = PFRFONT(14);
        [self addSubview:label];
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(_leftImg.mas_centerY);
            make.left.equalTo(_leftImg.mas_right).offset(15);
            make.width.equalTo(@40);
            make.height.equalTo(@20);
        }];
        
        _headImg = [UIImageView new];
        _headImg.image = IMAGE(@"header_default");
        _headImg.layer.cornerRadius = 47 /2;
        _headImg.layer.masksToBounds = YES;
        [self addSubview:_headImg];
        [_headImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.mas_centerY);
            make.right.equalTo(self).offset(-36);
            make.width.equalTo(@47);
            make.height.equalTo(@47);
        }];
        
        UIView *line = [UIView new];
        line.backgroundColor = COLOR_BACKGROUND;
        [self addSubview:line];
        [line mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self).offset(-1);
            make.left.and.right.equalTo(self);
            make.height.equalTo(@1);
        }];
    }
    return self;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
